// 统一导出函数
const fs  = require('fs');
const path  = require('path')

var obj = {};
fs.readdirSync(path.join(__dirname)).reverse().forEach((file) => {
    if (!file.endsWith('.js')) return;

    let fn = file.split('.').shift() || ''
    let fileModule = require(path.join(__dirname, file))
    obj[fn] = fileModule
})

module.exports = obj
